
#include <iostream>
#include <thread>

#include "catch2/catch.hpp"
#include "timer.hpp"

TEST_CASE("timer", "[timer]")
{
    Timer timer;

    // 模拟一个耗时操作
    std::this_thread::sleep_for(std::chrono::milliseconds(1500));

    std::cout << "Elapsed time in seconds: " << timer.tell_s() << " s" << std::endl;
    std::cout << "Elapsed time in milliseconds: " << timer.tell_ms() << " ms" << std::endl;
    std::cout << "Elapsed time in microseconds: " << timer.tell_us() << " us" << std::endl;
    std::cout << "Elapsed time in nanoseconds: " << timer.tell_ns() << " ns" << std::endl;
}